/**
 * 时间 ： 2014-6-9 下午2:04:50
 * 作者 ： HaiTao
 * 描述 ： 当前类的描述信息
 **/
package com.laitaoo.controller
{
	import com.laitaoo.event.StorageEvent;
	import com.laitaoo.service.StorageService;

	[Component]
	public class StorageController
	{
		public function StorageController()
		{}
		
		[Inject]
		public var storageService:StorageService;
		
		[EventHandler]
		public function storageListHandler(event:StorageEvent):void{
			storageService.storageList();		
		}
		
		/**
		 * 添加货物
		 * */
		[EventHandler]
		public function addStorageHandler(event:StorageEvent):void{
			
			if(event.storageId == "0"){
				storageService.addStorage(event.price,event.count,event.totalPrice,event.productId);	
			}else{
				storageService.updateStorage(event.price,event.count,event.totalPrice,event.storageId);
			}
		}
	}
}